#!/bin/sh
CURRENT_DIR="$(cd "$(dirname $0)"; pwd)"
cd $CURRENT_DIR
pwd
CURRENT_VERSION=`cat LAST_VERSION`
read -p "Enter Version($CURRENT_VERSION):" version
echo $version > LAST_VERSION
#WEBHOOK=https://flow-openapi.teambition.com/pipeline/webhook/Z8a04qFYb7bBq0sG6lit

cd $CURRENT_DIR/miniexchange
git pull
cd $CURRENT_DIR
git pull

./upload.sh $version

#curl --header "Content-Type: application/json" --request POST --data "{\"userversion\": \"$version\"}" $WEBHOOK
git add LAST_VERSION
git commit -m "PACKAGE COMMIT:$version"
git push